package com.xiaoluyy.demo.common.domain.dict;

public enum ValidType {

    Valid(Byte.valueOf("1"),"有效"),
    InValid(Byte.valueOf("0"),"无效");

    private ValidType(byte type,String name)
    {
        this.type =  type;
        this.name = name;
    }

    private byte    type;
    private String name;

    public static ValidType resolve(byte type) {
        if (type == 0 )
            return null;
        ValidType[] values = ValidType.values();
        for (ValidType value : values) {
            if (type==value.getType()) {
                return value;
            }
        }
        return null;
    }

    public byte getType() {
        return type;
    }
    public void setType(byte type) {
        this.type = type;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "ValidType type:"+type+",name:"+name ;
    }


}
